package cn.yeziji.forum.job;

import cn.yeziji.forum.utils.CacheUtils;
import cn.yeziji.forum.utils.RedisUtils;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 文章 redis 定时任务
 *
 * @author gzkemays
 * @since 2021/12/23 17:49
 */
@Component
public class RedisDetailsJob extends QuartzJobBean {
  @Resource RedisUtils redisUtils;
  @Resource CacheUtils cache;

  @Override
  protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
    // 获取当前时间

    //    String title = (String) context.getJobDetail().getJobDataMap().get("title");
    /*    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    System.out.println(dateFormat.format(System.currentTimeMillis()));
    System.out.println(redisUtils.getRedisTemplate().opsForZSet().range("zset", 0, -1));*/
  }
}
